<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="Content-Language" content="zh-CN"/>
        <meta name="robots" content="index, follow" />
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
        <title>氿上网</title>
        <?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>
        <script type="text/javascript">
            $(function(){
                $("#myform").validate({
                    rules: {
                        sex: "required",
                        province: "required"
                    },
                    messages: {
                        sex: "请选择性别!",
                        province: "请选择所在地!"
                    }
                });
            })
           
        </script>
    </head>
    <body>

        <div id="OSC_Screen">
            <?php echo $this->fetch('header.html'); ?>
            <div id="OSC_Content" class='CenterDiv'>
               <?php echo $this->fetch('user_nav.html'); ?>
                <?php echo $this->fetch('message.html'); ?>
                <div class="MainForm" id="reg_page">
                    <form id="myform" name="frm_reg" action="<?php echo $this->_var['site_url']; ?>userinfo/profile" method="post" style="float:left; width:620px;">
                        <table cellspacing='0' cellpadding='0'>
                            <tr id='tr_user'>
                                <th >用户名：</th>
                                <td>
                                    <?php echo $this->_var['data']['username']; ?>	
                                </td>    			
                            </tr>
                            <tr id='tr_user'>
                                <th >用户组：</th>
                                <td>
                                    <?php echo $this->_var['data']['group_name']; ?>	
                                </td>    			
                            </tr>
                            <tr id='tr_email'>
                                <th>电子邮箱：</th>
                                <td>
                                    <?php echo $this->_var['data']['email']; ?>
                                </td>    			
                            </tr>
                            <tr id='tr_user'>
                                <th >昵称：</th>
                                <td>
                                    <input type='text' name='nickname' id='nickname' value='<?php echo $this->_var['data']['nickname']; ?>' class='TEXT' style='width:200px;'/>
                                </td>    			
                            </tr>

                            <tr id='tr_user'>
                                <th >真是姓名：</th>
                                <td>
                                    <input type='text' name='realname' id='realname' value='<?php echo $this->_var['data']['realname']; ?>' class='TEXT' style='width:200px;'/>
                                </td>    			
                            </tr>

                            <tr id='tr_user'>
                                <th >出生日期：</th>
                                <td>
                                    <input type='text' name='birthday' id='birthday' value="<?php echo $this->_var['data']['birthday']; ?>" class='TEXT Wdate'  onClick="WdatePicker({minDate:'1950-01-01',maxDate:'2000-01-01'})"/>
                                </td>    			
                            </tr>
                            <tr id='tr_gender'>
                                <th>性别：</th>		
                                <td>
                                    <input type='radio' name='sex' value='1' id='gender_1' <?php if ($this->_var['data']['sex'] == 1): ?>checked<?php endif; ?>/><label for='gender_1'>男</label>&nbsp;&nbsp;&nbsp;
                                        <input type='radio' name='sex' value='2' id='gender_2'  <?php if ($this->_var['data']['sex'] == 2): ?>checked<?php endif; ?>/><label for='gender_2'>女</label>
                                            </td>	
                                            </tr>
                                            <tr id='tr_area'>
                                                <th>居住地区：</th>		
                                                <td><select name="province" id="province_id">
                                                        <option value=''>--请选择省份--</option> 
                                                        <?php $_from = $this->_var['province']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'p');if (count($_from)):
    foreach ($_from AS $this->_var['p']):
?>
                                                        <option value='<?php echo $this->_var['p']['id']; ?>' <?php if ($this->_var['data']['province'] == $this->_var['p']['id']): ?>selected='selected'<?php endif; ?>><?php echo $this->_var['p']['name']; ?></option>
                                                        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                                    </select>
                                                    <span id="sub_id">
                                                        <select name='city'>
                                                            <?php $_from = $this->_var['city']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
                                                            <option value="<?php echo $this->_var['c']['id']; ?>" <?php if ($this->_var['data']['city'] == $this->_var['c']['id']): ?>selected='selected'<?php endif; ?>><?php echo $this->_var['c']['name']; ?></option>
                                                            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                                        </select>
                                                    </span></td>
                                            </tr>
                             <tr id='tr_area'>
                                                <th>自我简介：</th>	
                                            <td class="y-bg"><textarea style="height:80px; width:100%" id="value" cols="50" rows="2" name="description"><?php echo $this->_var['data']['description']; ?></textarea>
                                            </td>
                                                </tr>
                                            <tr class='buttons'>
                                                <th>&nbsp;</th>		
                                                <td style='padding:20px 0;'>
                                                    <input type='submit' value=' 更改 ' class='BUTTON SUBMIT'/><br/><br/>
                                                </td>
                                            </tr>
                                            </table>
                                            </form>
                                            <div class='clear'></div>
                                            </div>

                                            </div>
                                            <div class='clear'></div></div>
                                            <div class='clear'></div>
                                            <?php echo $this->fetch('footer.html'); ?>
                                            </div>
                                            <script>
                                                $(function(){
                                                    $('#province_id').change(function(){
                                                        $.ajax({
                                                            url:"<?php echo $this->_var['site_url']; ?>ajax/sub",
                                                            type:'post',
                                                            dataType:'html',
                                                            data:'id='+$(this).val(),
                                                            success:function(data){
                                                                if(data){
                                                                    var html = "<select name='city'>";
                                                                    html +=data+"</select>";
                                                                    $('#sub_id').html(html);
                                                                }
                         
                                                            }
                                                        });
                                                    });
                                                });
                                            </script>
                                            </body>
                                            </html>
